import fetch from '@/utils/fetch';
import { ajax } from '@/utils/trip/ajax'

// 添加信息
export function addUser(obj) {
    return fetch({
      url: '/api/admin/user',
      method: 'post',
      data: obj
    });
}

// 创建excel并导出
export function getUserExcel() {
    return fetch({
      url: '/api/admin/user/excel',
      method: 'get',
    });
}
// 导入excel
export function putUserExcel(obj) {
    return fetch({
      url: '/api/admin/user/excel',
      method: 'put',
      data: obj
    });
}
// 获取对象信息excel模板
export function getUserExcelTemplate() {
    return fetch({
      url: '/api/admin/user/excel/template',
      method: 'get',
    });
}
// 批量删除对象信息
export function deleteAllUser(ids) {
    return fetch({
      url: '/api/admin/user/list',
      method: 'delete',
      data:ids
    });
}
// 查询全部对象信息
export function listAllUser() {
    return fetch({
      url: '/api/admin/user/list',
      method: 'get',
    });
}

// 分页查询列表
export function getUserTable(query) {
    return fetch({
      url: '/api/admin/user/pageList',
      method: 'get',
      params:query
    });
}
// 删除信息
export function delUser(id) {
    return fetch({
      url: '/api/admin/user/'+id,
      method: 'delete',
    });
}
// 获取信息详情
export function getUser(id) {
    return fetch({
      url: '/api/admin/user/'+id,
      method: 'get',
    });
}
// 修改对象信息
export function putUser(id,obj) {
    return fetch({
      url: '/api/admin/user/'+id,
      method: 'put',
      data:obj
    });
}

//个人中心-修改密码
export function editUserPassword(id,obj){
  return fetch({
    url: '/api/admin/user/'+id,
    method: 'put',
    data:obj
  });
}




